home *** CD-ROM | disk | FTP | other *** search
-
- #ifndef __DBELEMENTTOKEN__
- #define __DBELEMENTTOKEN__
-
- //
- // For class definiton of TAbstractDesignator
- //
- #include "AbstractDesignator.h"
-
- //
- // For AConst<> and AnUpdate<>
- //
- #include "ReferenceTemplates.h"
-
- #include "Int64.h"
-
- class TDBElement;
- class TTransaction;
-
- class TDBElementToken : public TAbstractDesignator
- {
- private:
- AConst<TDBElement> fRecord;
-
- public:
- DeclareSmallClassData(TDBElementToken, TAbstractDesignator);
-
- TDBElementToken(AConst<TDBElement> record);
- virtual ~TDBElementToken();
-
- virtual AConst<TDBElement> Record() { return fRecord; }
-
- virtual void CloneOwnedObjects();
-
- virtual DescType ObjectClass(const TAETransaction& t, Boolean recordedClass = false);
- virtual Boolean DerivedFromOSLClass(const TAETransaction& t, DescType objectClass);
-
- virtual TAbstractScriptableObject* ParentObject(const TAETransaction& t);
- virtual TAbstractObjectIterator* ElementIterator(const TAETransaction& t);
-
- virtual TAbstractScriptableObject* AccessByProperty(const TAETransaction& t, DescType propertyIdentifier);
-
- // These accessors are used less frequently:
-
- virtual TAbstractScriptableObject* AccessByUniqueID(const TAETransaction& t, DescType desiredClass, TDescriptor uniqueID);
-
- // Methods relating to the data types accessible to this object
-
- virtual DescType BestType(const TAETransaction& t, DescType propertyName);
- virtual DescType DefaultType(const TAETransaction& t, DescType propertyName);
- virtual Boolean CanReturnDataOfType(const TAETransaction& t, DescType propertyName, DescType desiredType);
-
- // Methods to override to provide data access to this object
-
- virtual TDescriptor GetProperty(const TAETransaction& t, DescType propertyName, DescType desiredType, unsigned long additionalInfo = 0);
- virtual void SetProperty(const TAETransaction& t, DescType propertyName, TDescriptor& data, unsigned long additionalInfo = 0);
-
- virtual TDescriptor GetProperties(const TAETransaction& t, DescType desiredType);
-
- // Make an object specifier for this object
-
- virtual TDescriptor BuildObjectSpecifier(const TAETransaction& t);
- virtual void MakeKeyDataForSelf(const TAETransaction& t, DescType& keyForm, TDescriptor& keyData);
- virtual TDescriptor BuildSpecifierForParent(const TAETransaction& t);
-
- // Event handlers
-
- virtual TDescriptor AECommand(const TAETransaction& t, long aeCommandID, TAbstractScriptableObject* auxObjects = nil, long auxInfo = 0);
- virtual TAbstractScriptableObject* CreateNewElement(const TAETransaction& t, DescType newObjectClass, TDescriptor initialData, TDescriptor initialProperties, Boolean& usedInitialData, Boolean& usedInitialProperties);
-
- // Compare a property of this object with a descriptor
-
- virtual Boolean CompareProperty(const TAETransaction& t, DescType propertyIdentifier, DescType comparisonOperator, TDescriptor compareWith);
-
- virtual Boolean ObjectsAreTheSame(const TAETransaction& t, TAbstractScriptableObject* objectToTest);
-
- Boolean IsMetaRoot();
- long RecordIndex();
- Int64 DocumentIdentifier();
-
- //
- // Used to redefine this token to represent a different database element
- //
- void AssignDifferentElement(AConst<TDBElement> record) { ASSERT(fReferenceCount == 0); fRecord = record; }
- };
-
- #endif
-